package app.models;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * @author Douglas Fernandes
 * @since 22/11/2013
 */

@Entity
@Table(name = "HORARIO")
public class Horario implements Pojo {

	private static final long serialVersionUID = 2566179657198813440L;
	
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "ID")
	private Long id;
	
	@NotNull(message = "O horario deve ser vinculado a um especialista")
	@Column(name = "ID_ESPECIALISTA")
	private Long idEspecialista;
	
	@Pattern(regexp = "[0-9]{2}:[0-9]{2}:[0-9]{2}", message = "A hora inical esta mal formada")
	@NotNull(message = "A hora inicial deve ser preenchida")
	@Column(name = "HORA_INICIAL", columnDefinition = "time")
	private String horaInicial;
	
	@Pattern(regexp = "[0-9]{2}:[0-9]{2}:[0-9]{2}", message = "A hora final esta mal formada")
	@NotNull(message = "A hora final deve ser preenchida")
	@Column(name = "HORA_FINAL", columnDefinition = "time")
	private String horaFinal;
	
	
	public void setId(Long id) {
		this.id = id;
	}

	public Long getId() {
		return id;
	}

	public void setHoraInicial(String horaInicial) {
		this.horaInicial = horaInicial;
	}

	public String getHoraInicial() {
		return horaInicial;
	}

	public void setHoraFinal(String horaFinal) {
		this.horaFinal = horaFinal;
	}

	public String getHoraFinal() {
		return horaFinal;
	}

}
